<template>
</template>

<script>
	export default {
		onShow: function() {
			let args = plus.runtime.arguments;
			if (args) {
				plus.runtime.arguments = null; //进入之后就把urlscheme清空要不然下一次oushow时还会执行
				// 处理args参数，如直达到某新页面等
				//通过code请求获取user_id
				var authCode = args.split("=")[1];
				if (authCode != undefined && authCode != "" && authCode != null) {
					this.$busapi.restAuth.queryAlipayInfo("authCode=" + authCode).then(res => {
							if (res.code == '0000') {
								if (res.data.userId) {
									this.whetherBinding(res.data.userId, "alipay");
								}

							} else {
								this.$message({
									message: res.msg,
									type: 'error'
								});
							}
						})
						.catch(res => {
							this.$message({
								message: res.errmsg,
								type: 'error'
							});
						});
				}
			}
		},
	}
</script>

<style>
</style>
